Electronic Grammars and Reproducible Research

نویسنده

  • Mike Maxwell
چکیده

Classes.LangClass.SFSTOutput(sFormat, ExtraArg) This SFSTOutput() function is defined for the class AlternativeContexts, which encodes a set of alternative phonological contexts forming part of the environment of such a phonological rule (or a phonologically determined allomorph); for example, the context of a long vowel or a vowel plus consonant. The function is called with an argument list specifying (among other things) a format. The only format this particular function knows about is called AsRegex; any other format is referred by the ‘else’ clause to a superclass of AlternativeContexts (here AbstractClasses.LangClass). Given this AsRegex argument, the function needs to output the alternatives in the format which SFST expects for a regular expression, namely a parenthesized list with list members separated by the character ‘|’. Since outputting of lists with various delimiters is a common task, the details of outputting the list (such as the need to output the separator character after every member of the list except the last) is here delegated to a more generic function, SFSTOutputList(), which takes as additional arguments (parameters) the character which starts the list (here an open parenthesis), the separator character (‘|’), and the character which marks the end of the list (a close parenthesis). This SFSTOutputList() function is not shown here; it is defined on an abstract superclass of AlternativesContext. The XML elements which constitute the alternatives (represented by X, Y and Z in the quoted comment) will be recursively output by SFSTOutput() functions defined on whatever classes these individual contexts belong to. For example, suppose a part of the grammar contains the following XML element (which happens to define a set of alternative contexts in Bangla26): (5) 26 This example is for expository purposes. From a theoretical perspective, it could be better treated as a context consisting of a single natural class, namely the vowels /i/, /u/ and /a:/. Electronic Grammaticography Electronic Grammars and Reproducible Research 230 When this snippet of XML is read by the converter, its elements will be converted into objects of the corresponding classes in the converter. The outermost element is an AlternativeContexts, and when the converter outputs this in the SFST format, the SFSTOutput() function in (4) will be called. It will then call the SFSTOutputList() function with the appropriate arguments; this function in turn calls the SFSTOutput() functions for the list members, namely for the simple contexts, which in turn output their information. For SFST, it happens that the simple contexts need only tell the phonemes27 to output themselves in the SFST format, completing the process. The resulting SFST code would look like this:

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Grammar-based Approach to Design and its Application to Electronics and Logic Programming

The paper describes how formal grammars can be used for knowledge representation in electronic design and how logic programming techniques can be applied for grammar representation and manipulation. The basic idea is that formal grammars can be used to explicitly represent design knowledge and design concepts usually not represented or accessible by design tools and that such design knowledge c...

متن کامل

Alternating Regular Tree Grammars in the Framework of Lattice-Valued Logic

In this paper, two different ways of introducing alternation for lattice-valued (referred to as {L}valued)  regular tree grammars and {L}valued top-down tree automata are compared. One is the way which defines the alternating regular tree grammar, i.e., alternation is governed by the non-terminals of the grammar and the other is the way which combines state with alternation. The first way is ta...

متن کامل

A Computational Lexicon Of Portuguese For Automatic Text Parsing

Using standard methods and formats established at LADL, and adopted by several European research teams to construct largecoverage electronic dictionaries and grammars, we elaborated for Portuguese a set of lexlcal resources, that were implemented in IN'rEX We describe the main features of such linguistic data, refer to their mmntenance and extension, and gwe different examples of automatic text...

متن کامل

The Syntax of Programming Languages-A Survey

The syntactic rules for many programming languages have been expressed by formal grammars, generally variants of phrase-structure grammars. The syntactic analysis essential to translation of programming languages can be done entirely mechanically for such languages. Major problems remain in rendering analyzers efficient in use of space and time and in finding fully satisfactory formal grammars ...

متن کامل

Simple LR ( k ) Grammars Franklin

A class of context-free grammars, called the "Simple LR(k)" or SLR(k) grammars is defined. This class has been shown to include weak precedence and simple precedence grammars as proper subsets. How to construct parsers for the SLR(k) grammars is also shown. These parser-construction techniques are extendible to cover all of the LR(k) grammars of Knuth; they have been implemented and by direct c...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2012